#include <iostream>
#include <iterator>
#include <string>
#include <algorithm>
using namespace std;

string s;

int main()
{
    cin >> s;
    reverse(s.begin(), s.end());
    string ans;
    s = " " + s;
    for(int i = 1; i < s.size(); i++)
    {
        ans += s[i];
        if(i % 3 == 0 && i != s.size() - 1) ans += ',';
    }
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}



